# Makefile for Address Book Management System

CC = gcc
CFLAGS = -Wall -std=c11 -O2
LDFLAGS =

TARGET = addressbook

SRCS = main.c Login.c Modify.c logger.c
OBJS = $(SRCS:.c=.o)
HEADERS = head.h

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)

%.o: %.c $(HEADERS)
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -f $(OBJS) $(TARGET)

.PHONY: all clean

main.o: main.c head.h
Login.o: Login.c head.h
Modify.o: Modify.c head.h
logger.o: logger.c head.h